<template>
  <view class="privacy-container">
    <web-view v-if="htmlPath" :src="htmlPath"></web-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      htmlPath: ''
    }
  },
  onLoad(options) {
    // type: 3为隐私协议，4为用户协议
    const type = options.type
    // 根据type确定加载哪个HTML文件
    if (type === '3') {
      // #ifdef H5
      this.htmlPath = '/pages/users/privacy/privacy-policy.html'
      // #endif
      // #ifndef H5
      this.htmlPath = '/hybrid/html/privacy-policy.html'
      // #endif
    } else if (type === '4') {
      // #ifdef H5
      this.htmlPath = '/pages/users/privacy/user-agreement.html'
      // #endif
      // #ifndef H5
      this.htmlPath = '/hybrid/html/user-agreement.html'
      // #endif
    }
  }
}
</script>

<style lang="scss">
.privacy-container {
  width: 100%;
  height: 100vh;
}
</style> 